import { ecs } from "db://app-game/libs/ecs/ECS";
import { DBSkillIcon } from "../../../common/db/db-skill-icon/DBSkillIcon";
import { DBSkillIconType } from "../../../common/db/db-skill-icon/DBSkillIcon.type";

@ecs.register("SkillIconModel")
export class SkillIconModelComp extends ecs.Comp {
  db: DBSkillIcon = new DBSkillIcon();
  _id: number = -1;
  /** 角色编号 */
  get id(): number {
    return this._id;
  }
  set id(val: number) {
    this._id = val;
    this.db.init(val);
    this.data = this.db.data;
  }
  /** 摇杆数据 */
  data: DBSkillIconType = null!;

  reset(entity: ecs.Entity): void {
    this._id = -1;
    this.data = null!;
  }
}
